package Observer;

import java.util.List;
import java.util.stream.Collectors;

public class WordObserver implements Observer {
    private List<String> wordList;
    @Override
    public void update(Text t) {
        List<String> text = t.getText();
        wordList = text.stream().distinct().sorted()
            .collect(Collectors.toList()); 
    }

}
